 <script>
 function  tab_shou(id){
	 $(".choose_type").css("display","none");
	  $("#"+id).css("display","block");
	 }
 </script>
 <style>
 .xz{width:100%; background:#FFF}
 
 </style>
 <!-- 共用头部1 -->
	 <div id="top">
		 <div class="head1 clear">
			 <div class="account sprite_icon" style="text-align:center; ">
                  <a href="index.php?g=Mobile&m=User&a=index" style=" color:#FFF; line-height:50px">
                 {if cookie('username')}
                  {php $user=M('User')->field('username')->where('id='.$jgsatuserid)->find()}
                  {php echo $user['username']} 
                 {else}登录
                 {/if}
                 </a>
			 </div>
               {if $title}
			    <div class="title">{$title}</div> 
               {else}
                <div class="title">{$seo_title}</div> 
               {/if}
 <div class="search sprite_icon">
			     <span class="icon2 icon_com">
			 </div>
		 </div>
	 </div>
<include file="Mobile:nav"/>     
    <!-- <div class="xz">
        <ul>
           <span>风格</span>&nbsp;&nbsp;&nbsp;&nbsp;<span>类型</span>
        </ul>
     </div>-->
	 <div class="choose">
		 <ul class="choose_btn clear">
			 <li class="active"><a href="index.php?g=Mobile&m=Case&a=index&id=2">全部</a></li>
			 <!--<li><a href="javascript:tab_shou('style');">风格</a></li>-->
			 <li><a href="javascript:tab_shou('type');">类型</a></li>
		 </ul>

		 
         <div class="choose_type" id="type">
			 <div class="clear">
				<YP:list name="Label" where="genre=17" id="r" order="listorder asc" limit="50">
                    <a  style=" border:#FFF solid 0px;" href="{:unsetParam('itemType',$url_s)}&itemType={$r['id']}"> <span {if ($_GET['itemType']==$r['id'])}class="active" {/if}>{$r['title']}</span></a>
                </YP:list>
			 </div>

			 <div class="center">
				 <a href="javascript:tab_shou(1);" class="sure">
					关闭
				 </a>
			 </div>
		 </div>
	 </div>
 <style>
 .ldy{
	 margin-left:15%
	 }
 </style>

	 <div class="P_mod_effect_catering">
         <ul class="list clear" id="tabajax">
             
            <volist name="list" id="r"  key="k">
             <li class="part {if $k%2==0}no_margin{/if}">
                 <div class="padding">
                     <div class="pic">
                         <a href="index.php?g=Mobile&m=Case&a=show&id={$r.id}"><img src="{$r.thumb_list}" alt="" /></a>
                     </div>
                     <div class="info"> <a href="index.php?g=Mobile&m=Case&a=show&id={$r.id}">{$r.title|str_cut=###,18}</a><!--<span>{$r['createtime']|date="m-d",###}</span>-->
                     </div>
                     <div class="sprite_icon sociality clear ldy">
                         <a href="javascript:;">
                             <span class="icon_com icon4"></span><i>{$r.hits}</i>
                         </a>
                         <a href="javascript:;">
                             <span class="icon_com icon5"></span><i>{$r.com_num}</i>
                         </a>
                         <a href="javascript:onclick=keep({$id})" class="no_margin">
                             <span class="icon_com icon6"></span><i>{$r.keep_num}</i>
                         </a>
                     </div>
                 </div>
             </li>
            </volist>
         </ul>
     </div>
     <div class="psges" name="{$url_s}&p=2">下拉加载更多</div>
     {if empty($list)}
       <div style="width:100%; height:300px;"></div>
     {/if}
  <script type="text/javascript">
function  keep(id){
	
	
		  var module='Case';
		  
		  var url=window.location.search;
		      url='index.php'+url;
		  var title=$(".title h2").html();
		 
      //alert(title);
		  //var userid=$("#keep_u").attr('name');
		 // alert(userid)
	
		  $.post(
				  'index.php?g=User&m=Index&a=keep', 
				  {'id':id,
				   'module':module,
				   'url':url,
				   'title':title,
				   'catid':2
				  },
				  function(res){
					 if(res.length>1000){
						 alert('您还未登录，请您先登录');
						 } else{
							 alert(res)
						      if(res=='收藏成功!'){
							  var keepnum=parseInt($(".keep_n").html())+1;
							  $(".keep_n").html(keepnum);
							  }
						 
						 }
					 
					});
	  
	}

</script>

<style>
  #footer{ display:none}
  </style>  
<script>
     $(window).scroll(function()
 
   {
 
    if ($(window).scrollTop() == $(document).height() - $(window).height())
 
    {
 
         var url=$('.psges').attr("name");
		 $('.psges').html('加载中...');
	   //alert(url)
		 $.ajax({
			type:"GET",
			url: url,
			//data: "name=John&location=Boston",
			dataType:'json', //数据类型
			success: function(msg){
				if(msg.list){
					var result_len=msg.list.length;
					for(var i=0;i<result_len;i++){
						//var unixTimestamp = new Date(msg.list[i].createtime * 1000) ;
                        //var commonTime = unixTimestamp.toLocaleDateString();
						 var  html='';
					      html+='<li class="part '; 
						  if(i%2!=0){ 
						  html+='no_margin ';
						  }
						  html+='">';
                          html+='<div class="padding">';
                          html+='<div class="pic">';
                          html+='<a href="index.php?g=Mobile&m=Case&a=show&id='+msg.list[i].id+'">';
						  html+='<img src="'+msg.list[i].thumb_list+'" alt="" /></a>';
						  html+='</div>';
                          html+='<div class="info">';
						     var m =msg.list[i].title.length; 
							 //alert(m)
						     var title=msg.list[i].title.substr(0, 8)
							 if(m>8){
								 title+='...';
								 }
							
						  html+='<a href="index.php?g=Mobile&m=Case&a=show&id='+msg.list[i].id+'">'+title+'</a>';
						 /* html+='<span>'+msg.list[i].date+'</span>';*/
                          html+='</div>';
                          html+='<div class="sprite_icon sociality clear ldy">';
                          html+='<a href="javascript:;">';
                          html+='<span class="icon_com icon4"></span><i>'+msg.list[i].hits+'</i>';
                          html+='</a>';
                          html+='<a href="javascript:;">';
                          html+='<span class="icon_com icon5"></span><i>'+msg.list[i].com_num+'</i>';
                          html+='</a>';
                          html+='<a href="javascript:onclick=keep('+msg.list[i].id+')" class="no_margin">';
                          html+='<span class="icon_com icon6"></span><i>'+msg.list[i].keep_num+'</i>';
                          html+='</a>';
                          html+='</div>';
                          html+='</div>';
                          html+='</li>';
							
					 
					  $("#tabajax").append(html);
					}
					 $('.psges').attr('name',msg.p);
					 $('.psges').html('下拉加载更多');
					 
					}else{ $('.psges').html('没有更多');  }
				    
					
			   
			  
				}
	   
				
		});
	   
 
    }
 
   });
   

</script>    